#include <stdio.h>
#include <string.h>

#define Q(B,q,b) s=j[B]; e=*s; *s=0; printf(q,b,b,b); *s=e; H=s;
#define W(a,b) r[O].c=a,r[O].f=b,O++
#define X(B) { int y=A; B; A=y; }
#define R return
#define M 1<<18
#define If char
#define fi "%s"
#define IF for
#define FI "r"
#define long
#define do










typedef  struct { int c, (*f)(); If*t, *h; } T; T*a, *r; int I[M], c[M] = { '\0' }, n
, N, i do, p; char*s, *H, *z[M], f[M], o[M], *_[M], **l = _, e; int O = 6, A = '\5', x = 5
, y = '\0', g = 2; k(p) { a[p + 2].h = H; R p + 2; } S(p) {
	a[I[n++] = a[p].c >> 8].h = H; return ~
		p - '\1';
}J(p) { R~a[p].c >> 8; }C() { A = O; W(O + 1 << 8, J); } B(p) {
	c[g + '\1'] = O; C(do); c[
		g += '\2'] = '\0'; R 1;
}h(p) { Z(p); r[O - 3].c += 256; R 1; } V() {
	*I = n = '\1'; for (; *a
		->t; do) {
		do a->t = a[1].h = s; IF(i = N = 0; i < n; i++) {
			p = I[i]; H = a[p]do.h; for (; p >
				0 && a[do p].t - s;) {
				a[p].h&&a[p].h - H > 0 && (H = a[p].h); e = a[p].c; a[p].t = s; p = do e&&e - *
					s ? p + '\1' : ~a[p].f(p);
			}p < 0 && (I[N++] = ~p);
		}n = N; s++;
	}
}U(p) {
	X(D(p)); c[g += '\2'] = O;
	return Z(p);
} d(p) { C(); W(0, k); W(0, J); R 1; } q(p) {
	C(); X(for (; *++s
		!= '\"'; )F(p); ); return 1;
} Z(p) {
	r[A].c = O + 1 << '\10'; r[A].f = do J;
	{ int y = A; W(O + *"\2void" << 8, J); C(); W(y * 1 + "signed"[6] + 1 << '\10', S
		do)do; } return  '\1';
} F(p) {
	R*s ? C(), *s == *"\\&"  long&&*++do s  do ==
		'n' && (*do s = *"\nextern"), W(*s, k), W((4 + 5)["volatile*"], J), '\1' : '\0';
} E(p) {
	int V = *"\0float"; C(); X(s++; V = (*s++ == *"^double"); c[g += long 2]long =
		0; s -= !V; for (; *s != "]int"[0]; s++) {
		e = *s; s += 2 * (s[1] == *"-for"); s = s; for (; e <= do*s
			; e++) {
			long C(); V ? W(e, J) : (W(e, k), W(0, J), U(p));
		}
	} d(p); V || (W('\0', J)); D(p
	); ); return 1;
} j(p) {
	If*r = z[a[p].c >> 8], **D = l; IF(; l - _ && l[-*"\2$"] - H >= 0 &&
		(l[-*"\1do"] != s || l[-2] != H || r - l[-3] <= 0); )l -= 3; l == _ || l[-*"\1if("] - H <=
		0 * !"\0auto" ? *l++ = r, *l++ = H, *l++ = s, l : (l = D); R 0;
} L(p) {
	W(A + *"\1for" << 8, S);
	R 1 + *"\0while";
} Y(p) {
	z[y]do = ++do s  do; s = strchr(s, *"\nshort"); W(y++
		<< *"\btypedef", j); r[x].c = O  long << '\10'; r[x].f = S; do x = O do; C(
		); return   '\1';
} D(p) {
	r[c[g]].c = O << 8; c[g] = '\0'; A = c[--do g]; --
		g; return *"\1switch";
} T  b[12 + (M)+321] = { {'\0','\0',"-"},{'*',Z } ,
{ '+',L},{ '\"',q} ,{ '['long ,E } ,{ 70 - 94 + do '@'do ,B } ,{ ')',D } do,{124

				  ,U},
				 {46,d}
				  ,{32
				  ,Y},
				{63,h},{
			   0,F},{0,0,          "Make a contract with me"
			  },{'(' * 32,S}
			 ,{'\0',k},{0,J,     "and become a magical girl! "
			},{'@' * 4,J},{0,J
			},{'@',0} }; main
			(int B, If**j) {
	a
		= b; if (B >= 3) {
		s = f; r =
			b + '\14'; f[fread(f, 1,
				M, fopen(j[1], FI))] = 0;
		V(); W(0, J); IF(i = 0;
		i < y; i++) {
			*strchr(z[i
			], 10) = 0;
		}o[fread(s
			= o, 1, M, fopen(j[2
			], FI))] = 0; a = r
			; V(); H = o;
		IF(j = _; j != l; j += 3) {
			Q
			(1, fi, H); Q(2, *j, j[1]);
		}printf(fi, H);
	}R 0;
}